%Elaborate on the program structure
\begin{figure}[ht]
\centering
\includegraphics[trim=10mm 53mm 103mm 15mm,clip,width=\textwidth]{./images/pipeline.pdf}
\caption{Illustration of the pipeline transforming data into an image. \texttt{Dataset} and \texttt{Visualizer} are general classes that have multiple implementations. This allows for a very flexible visualization that can show multiple datasets simultaneously.}
\label{fig:pipeline}
\end{figure}

The structure of our visualization program is modular. Even though the
visualization pipeline can be implemented as a direct mapping from data to
image, it is often desirable to construct a modular application as this makes
design and reuse of particular methods and structures
easier~\cite{scivisbookch04}. Datasets, visualization routines and the user
interface are separated in different classes. The visualization pipeline (see
introduction) is split into four main functional stages:

\begin{enumerate}
\item Dataset acquisition 
\item Dataset enrichment
\item Mapping data to visual objects and rendering these objects on the reference grid
\item Translating the reference grid to the final view.
\end{enumerate}

Each of these stages, with the exception of the last, can be carried out by numerous functional objects. Figure~\ref{fig:pipeline} illustrates the modular structure of our program. Both Dataset and Visualizer are general classes that have multiple implementations. Because of this modular structure adding, visualizers and datasets takes very little time. This results in an application with a large number of different visualization options.

\begin{figure}[ht]
\begin{subfigure}[b]{.5\linewidth}
\centering
\includegraphics[trim=0mm 0mm 10mm 10mm,clip,width=65mm]{./images/ex_glyph_smoke.png}
\caption{Using smoke and glyphs.}\label{sub:smoke_glyphs}
\end{subfigure}%
\begin{subfigure}[b]{.5\linewidth}
\centering
\includegraphics[trim=0mm 0mm 10mm 14.5mm,clip,width=65mm]{./images/ex_glyph_only.png}
\caption{Using only glyphs.}\label{sub:glyphs_only}
\end{subfigure}
\caption{The same dataset visualized in two different ways. In panel \subref{sub:smoke_glyphs}, the fluid velocity is visualized using the smoke visualizer, both the density and the density gradient field are visualized using the glyphs. The coloring of the glyphs depicts density and the direction shows the density gradient. In panel \subref{sub:glyphs_only}, both the velocity, density and gradient are visualized using glyphs. The glyph color shows velocity, the glyph direction and size depict the gradient magnitude and direction and the density is coded as alpha values for the coloring, so glyphs in low-density areas are better visible.}
\label{fig:vis_example1}
\end{figure}

For example, assuming we want to visualize two scalar fields: fluid density and absolute fluid velocity, and one vector field: density gradient. There are numerous ways we could do this. In figure~\ref{fig:vis_example1}, two possibilities are shown. Because the \texttt{Glyphs} visualizer can use up to three datasets (one vector dataset, and one or two scalar datasets), we could use only the \texttt{Glyphs} visualizer, like in figure~\ref{sub:glyphs_only}. However, looking at figure~\ref{sub:smoke_glyphs}, we could also use the \texttt{Smoke} visualizer to show one of the scalar fields and use the \texttt{Glyphs} for the other two.

The application is designed to dynamically change which visualizers are active and what dataset(s) they use, this leaves a lot of freedom to the user to create appealing images and emphasize different phenomena of interest.

A detailed of the \texttt{Dataset} classes and objects can be found in section~\ref{sec:datasetrepresentation}. The \texttt{Visualizers} are discussed in sections~\ref{sec:scalarvis} and~\ref{sec:vectorvis}.
